<?php
/**
 * 
 * @author tangbl
 *
 */
class CommonAction extends Action {

    /**
     * 初始化
     * 子类重写_initialize方法需要调用parent::_initialize();
     */
    public function _initialize() {
		
    	$t     = C('VAR_TEMPLATE');
		$theme = $this->_param("$t","","");
		if(empty($theme)){//待处理
			$theme = C('DEFAULT_THEME');
		}
		if(!strpos('|'.C('THEME_LIST'),$theme)){
			$theme = C('DEFAULT_THEME');
		}
		cookie('think_template',$theme,3600);
		
		$NOW_THEME_PATH = TMPL_PATH.$theme.'/';
		$NOW_THEME_URL  = TMPL_URL .$theme.'/';
		
		$this->assign('NOW_THEME_PATH',$NOW_THEME_PATH);
		$this->assign('NOW_THEME_URL' ,$NOW_THEME_URL);
		define('NOW_THEME_NAME', $theme);
		
		$value = get_syscfig_key("webnamezh-cn");
		$this->assign('webname' ,$value);
    }
	
	//定义空操作
	public function _empty(){
		$this->error(L('cfg_form_action_noexsits'));
	}
	
}